package com.huabo.contract.oracle.mapper;

import com.huabo.contract.oracle.entity.TblAttachment;
import com.huabo.contract.oracle.entity.TblContractSpnode;
import com.huabo.contract.oracle.entity.TblCyhwProjectbudget;

import net.sf.json.JSONObject;

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hbfk.entity.TblStaffUtil;
import com.hbfk.util.PageInfo;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huabo
 * @since 2021-10-23
 */
public interface TblCyhwProjectbudgetMapper extends BaseMapper<TblCyhwProjectbudget> {

	@SelectProvider(method="selectListByPageInfo",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	List<TblCyhwProjectbudget> selectListByPageInfo(PageInfo<TblCyhwProjectbudget> pageInfo, TblStaffUtil staff,
			Integer taskCount) throws Exception;

	@SelectProvider(method="selectCountByPageInfo",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer selectCountByPageInfo(PageInfo<TblCyhwProjectbudget> pageInfo, TblStaffUtil staff, Integer taskCount) throws Exception;

	@SelectProvider(method="selectRepearBudgetName",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer selectRepearBudgetName(String budgetname, BigDecimal orgid, Integer budgetId) throws Exception;

	@InsertProvider(method="insertOppositeParty",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	@Options(useGeneratedKeys=true, keyProperty="budgetid", keyColumn="BUDGETID")
	void insertOppositeParty(TblCyhwProjectbudget tcpb,Integer sealorgid) throws Exception;
	
	@InsertProvider(method="insertOppositePartyOld",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	@Options(useGeneratedKeys=true, keyProperty="budgetid", keyColumn="BUDGETID")
	void insertOppositePartyOld(TblCyhwProjectbudget tcpb) throws Exception;

	@Insert("INSERT INTO TBL_CYHW_PROJECTBUDGET_ATT(BUDGETID,ATTID) VALUES(#{buegetId},#{attId})")
	void insertAttmentRelation(@Param("attId")String id, @Param("buegetId")Integer budgetid);

	@Select("SELECT INSPECTIONSTATUS FROM TBL_CYHW_PROJECTBUDGET WHERE BUDGETID = #{budgetId}")
	Integer selectStatusByBudgetId(@Param("budgetId") Integer budgetId) throws Exception;

	@Select("SELECT TCP.BUDGETID,TCP.BUDGETNAME,TCP.FLOWID,TCP.TOTALTMONEY,TCP.FINANCEMONEY,TCP.OTHERMONEY,TCP.GOODSTYPE,TCP.SERVICETYPE,TCP.PROJECTTYPE,TCP.ORTHERTYPE,TCP.ISGOVERNMENT,TCP.ISDIRECT,TCP.ITEMBUDGETTYPE,TCP.PROJECTEASON,TCP.PROJECTGOAL,TCP.PROJECTSTAGEGOAL,TCP.PROJECTCONDITION,TCP.PROJECTRISK,TCP.CREATETIME,TCP.INSPECTIONSTATUS,TCP.GOODSPRICE,TCP.GOODSAMOUNT,TCP.GOODSMODEL,TCP.COUNTERPARTNO,TCP.COUNTERPARTADDRESS,TCP.COUNTERPARTCODE,TCP.COUNTERPARTHANK,TCP.COUNTERPARTHANKACCOUNT,TCP.COUNTERPARTNETADDRESS,TCP.COUNTERPARTPHONE,TCP.RECORDTYPE,TCP.RECORDCONCAT,TCP.ACTION,TCP.EQBFLOWID,TCP.BIZNO,TCP.RESULTDESCRIPTION,TCP.EQBSTATUS,TCP.FLOWTYPE,TCP.EABFILECK,TCP.FILEURL,TCP.OPPOSITENATURE,TCP.COUNTERPARTTYPE,TCP.ISEFFECT,TCP.COUNTERPARTDESC,TCP.SAFEORG,TCP.SAFESTAFF,TCP.EFFECTDATE,TCP.SAFEDATE,TCP.DIRECTOR,TCP.CONTACTS,TCP.CONTACTSPHONE,TCP.CONTACTSADRESS,TCP.CONTACTSEMAIL,TCP.STATION,TCP.CALLNAME,TCP.REMARKS,TCP.ISBLACK,TCP.BLACKTYPE,TCP.PSTARTDATE,TCP.PENDDATE,TCP.CRETIFICATENO,CTS.STAFFID CREATESTAFFID,CTS.REALNAME CREATEUSERNAME,LINKORG.ORGID LINKORGID,LINKORG.ORGNAME LINKORGNAME,RELADEPT.ORGID RELADEPTID,RELADEPT.ORGNAME RELADEPTNAME ,REPORTDEPT.ORGID REPORTDEPTID,REPORTDEPT.ORGNAME REPORTDEPTNAME,TCU.CONTRACTNAME CONTRACTNAME,TCU.CONTRACTID CONTRACTID"
			+ ",TFL.FLOWID,TFL.FLOWNUMBER,TFL.FLOWNAME,TFL.SETTINGID,TFL.EDITMODULE,TFL.FLOWMAPPINGURL"
			+ " FROM TBL_CYHW_PROJECTBUDGET TCP LEFT JOIN TBL_FLOW TFL ON TCP.FLOWID = TFL.FLOWID LEFT JOIN TBL_STAFF CTS ON TCP.CREATEUSER = CTS.STAFFID LEFT JOIN TBL_ORGANIZATION LINKORG ON LINKORG.ORGID = TCP.ORGID LEFT JOIN TBL_ORGANIZATION RELADEPT ON RELADEPT.ORGID = TCP.LINKDEPR LEFT JOIN TBL_ORGANIZATION REPORTDEPT ON REPORTDEPT.ORGID = TCP.REPORTTODEPT LEFT JOIN TBL_CYHW_UNIT TCU ON TCP.RECORDPARENT = TCU.CONTRACTID " +
			" WHERE TCP.BUDGETID = #{budgetId}")
	@Results({
		@Result(column="BUDGETID",property="budgetid"),
		@Result(column="BUDGETNAME",property="budgetname"),
		@Result(column="TOTALTMONEY",property="totaltmoney"),
		@Result(column="FINANCEMONEY",property="financemoney"),
		@Result(column="OTHERMONEY",property="othermoney"),
		@Result(column="GOODSTYPE",property="goodstype"),
		@Result(column="SERVICETYPE",property="servicetype"),
		@Result(column="PROJECTTYPE",property="projecttype"),
		@Result(column="ORTHERTYPE",property="orthertype"),
		@Result(column="ISGOVERNMENT",property="isgovernment"),
		@Result(column="ISDIRECT",property="isdirect"),
		@Result(column="ITEMBUDGETTYPE",property="itembudgettype"),
		@Result(column="PROJECTEASON",property="projecteason"),
		@Result(column="PROJECTGOAL",property="projectgoal"),
		@Result(column="PROJECTSTAGEGOAL",property="projectstagegoal"),
		@Result(column="PROJECTCONDITION",property="projectcondition"),
		@Result(column="PROJECTRISK",property="projectrisk"),
		@Result(column="CREATETIME",property="createtime"),
		@Result(column="INSPECTIONSTATUS",property="inspectionstatus"),
		@Result(column="GOODSPRICE",property="goodsprice"),
		@Result(column="GOODSAMOUNT",property="goodsamount"),
		@Result(column="GOODSMODEL",property="goodsmodel"),
		@Result(column="COUNTERPARTNO",property="counterpartno"),
		@Result(column="COUNTERPARTADDRESS",property="counterpartaddress"),
		@Result(column="COUNTERPARTCODE",property="counterpartcode"),
		@Result(column="COUNTERPARTHANK",property="counterparthank"),
		@Result(column="COUNTERPARTHANKACCOUNT",property="counterparthankaccount"),
		@Result(column="COUNTERPARTNETADDRESS",property="counterpartnetaddress"),
		@Result(column="COUNTERPARTPHONE",property="counterpartphone"),
		@Result(column="RECORDCONCAT",property="recordconcat"),
		@Result(column="ACTION",property="action"),
		@Result(column="EQBFLOWID",property="eqbflowid"),
		@Result(column="BIZNO",property="bizno"),
		@Result(column="RESULTDESCRIPTION",property="resultdescription"),
		@Result(column="EQBSTATUS",property="eqbstatus"),
		@Result(column="FLOWTYPE",property="flowtype"),
		@Result(column="EABFILECK",property="eabfileck"),
		@Result(column="FILEURL",property="fileurl"),
		@Result(column="OPPOSITENATURE",property="oppositenature"),
		@Result(column="COUNTERPARTTYPE",property="counterparttype"),
		@Result(column="ISEFFECT",property="iseffect"),
		@Result(column="COUNTERPARTDESC",property="counterpartdesc"),
		@Result(column="SAFEORG",property="safeorg"),
		@Result(column="SAFESTAFF",property="safestaff"),
		@Result(column="EFFECTDATE",property="effectdate"),
		@Result(column="SAFEDATE",property="safedate"),
		@Result(column="DIRECTOR",property="director"),
		@Result(column="CONTACTS",property="contacts"),
		@Result(column="CONTACTSPHONE",property="contactsphone"),
		@Result(column="CONTACTSADRESS",property="contactsadress"),
		@Result(column="COUNTERPARTTYPE",property="counterparttype"),
		@Result(column="CONTACTSEMAIL",property="contactsemail"),
		@Result(column="STATION",property="station"),
		@Result(column="CALLNAME",property="callname"),
		@Result(column="REMARKS",property="remarks"),
		@Result(column="ISBLACK",property="isblack"),
		@Result(column="BLACKTYPE",property="blacktype"),
		@Result(column="PSTARTDATE",property="pstartdate"),
		@Result(column="PENDDATE",property="penddate"),
		@Result(column="CRETIFICATENO",property="cretificateno"),
		@Result(column="CREATESTAFFID",property="createStaff.staffid",id=true),
		@Result(column="CREATEUSERNAME",property="createStaff.username"),
		@Result(column="LINKORGID",property="linkOrg.orgid",id=true),
		@Result(column="LINKORGNAME",property="linkOrg.orgname"),
		@Result(column="RELADEPTID",property="relaDept.orgid",id=true),
		@Result(column="RELADEPTNAME",property="relaDept.orgname"),
		@Result(column="REPORTDEPTID",property="reportDept.orgid",id=true),
		@Result(column="REPORTDEPTNAME",property="reportDept.orgname"),
		@Result(column="CONTRACTID",property="recordUnit.contractid",id=true),
		@Result(column="CONTRACTNAME",property="recordUnit.contractname"),
		@Result(column="FLOWID",property="flowInfo.flowid",id=true),
		@Result(column="FLOWNUMBER",property="flowInfo.flownumber"),
		@Result(column="FLOWNAME",property="flowInfo.flowname"),
		@Result(column="SETTINGID",property="flowInfo.settingid"),
		@Result(column="EDITMODULE",property="flowInfo.editmodule"),
		@Result(column="FLOWMAPPINGURL",property="flowInfo.flowmappingurl"),
	})
	TblCyhwProjectbudget selectAllInfoById(@Param("budgetId") Integer budgetId) throws Exception;

	@UpdateProvider(method="updateOppositeInfoById",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	void updateOppositeInfoById(TblCyhwProjectbudget tcpb,Integer sealorgid) throws Exception;

	@Delete("DELETE FROM TBL_CYHW_PROJECTBUDGET_ATT WHERE BUDGETID = #{budgetId}")
	void deleteRelaFileInfo(@Param("budgetId") Integer newBudgetId) throws Exception;

	@Delete("DELETE FROM TBL_ATTACHMENT WHERE ATTID IN (SELECT ATTID FROM TBL_CYHW_PROJECTBUDGET_ATT WHERE WHERE BUDGETID = #{budgetId})")
	void deleteOppsiteFileInfoByBudtetId(@Param("budgetId") Integer newBudgetId);

	@Delete("DELETE FROM TBL_CYHW_PROJECTBUDGET WHERE BUDGETID = #{budgetId}")
	void deleteOppsiteInfoByBudtetId(@Param("budgetId") Integer newBudgetId) throws Exception;

	@Update("UPDATE TBL_CYHW_PROJECTBUDGET SET INSPECTIONSTATUS = #{inspectionstatus} WHERE BUDGETID = #{budgetid}")
	void updateInspectionStatus(TblCyhwProjectbudget entity) throws Exception;

	@Update("UPDATE TBL_CYHW_PROJECTBUDGET SET ISBLACK = 1,BLACKTYPE = #{blackType} ,EFFECTDATE = TO_DATE(#{datetext},'yyyy-mm-dd') WHERE BUDGETID = #{budgetId}")
	void updateOppsitePartyBlack(@Param("budgetId") Integer budgetId, @Param("blackType")Integer blackType,@Param("datetext") String datetext) throws Exception;
	@Update("UPDATE TBL_CYHW_PROJECTBUDGET SET ISBLACK = 1,BLACKTYPE = #{blackType} WHERE BUDGETID = #{budgetId}")
	void updateOppsitePartyBlackByDate(Integer budgetId, Integer blackType, String datetext);

	@Update("UPDATE TBL_CYHW_PROJECTBUDGET SET ISBLACK = 2,BLACKTYPE = '',EFFECTDATE='' WHERE BUDGETID = #[budgetId]")
	void deleteOppsitePartyBlack(@Param("budgetId")Integer budgetId) throws Exception;

//	@Select("SELECT COUNT(0) FROM TBL_CONTRACT_SPNODE WHERE ISWY='是' AND NODEPOST IS NOT NULL AND CONTRACTID IN (SELECT CONTRACTID FROM TBL_CYHW_UNIT WHERE CONTRACTXDFXINFO = #{budgetid}")
//	Integer selectListByXdf(@Param("budgetid")Integer budgetid) throws Exception;

	@Select("select COUNTERPARTNO,BUDGETNAME,NVL(PROJECTSTAGEGOAL, 0) PROJECTSTAGEGOAL,SERVICETYPE,TOTALTMONEY,case when isBlack ='1' then '是' else '否' end ISBLACK,CASE BLACKTYPE WHEN 1 THEN '短期' WHEN 2 THEN '长期' ELSE '未加入' END BLACKTYPE,TO_CHAR(EFFECTDATE,'yyyy-MM-dd') EFFECTDATE from TBL_CYHW_PROJECTBUDGET where RECORDTYPE='HTGL001' AND BLACKTYPE IS NOT NULL  AND ORGID = #{orgid} ")
	@Results({
		@Result(column="COUNTERPARTNO",property="counterpartno"),
		@Result(column="BUDGETNAME",property="budgetname"),
		@Result(column="PROJECTSTAGEGOAL",property="projectstagegoal"),
		@Result(column="SERVICETYPE",property="servicetype"),
		@Result(column="TOTALTMONEY",property="totaltmoney"),
		@Result(column="ISBLACK",property="financemoney"),
		@Result(column="BLACKTYPE",property="othermoney"),
		@Result(column="EFFECTDATE",property="projecttype"),
	})
	
	List<TblCyhwProjectbudget> selectBlackList(@Param("orgid")BigDecimal orgid) throws Exception;


	@SelectProvider(method="findCollectionChoiceContractPid",type=TblCyhwProjectbudgetMapperSqlConifg.class)
    List<TblCyhwProjectbudget> findCollectionChoiceContractPid(PageInfo<TblCyhwProjectbudget> pageInfo, TblCyhwProjectbudget tcpb);

	@SelectProvider(method="findCollectionChoiceContractPidCount",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer findCollectionChoiceContractPidCount(TblCyhwProjectbudget tcpb);

	@SelectProvider(method="findListByPageInfo",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	List<TblCyhwProjectbudget> findListByPageInfo(PageInfo<TblCyhwProjectbudget> pageInfo, String orgid);
	@SelectProvider(method="findCountByPageInfoCount",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer findCountByPageInfoCount(PageInfo<TblCyhwProjectbudget> pageInfo, String orgid);

	@Select("SELECT TCP.*,TS.*,SEALORG.ORGNAME SEALORGNAME FROM TBL_CYHW_PROJECTBUDGET TCP " +
			"LEFT JOIN TBL_STAFF TS ON TCP.CREATEUSER = TS.STAFFID " +
			"LEFT JOIN TBL_ORGANIZATION SEALORG ON SEALORG.ORGID = TCP.SEALORGID " +
			"WHERE TCP.BUDGETID = #{budgetId}")
	TblCyhwProjectbudget findBybudgetId(Integer budgetId);

	@Select("SELECT * FROM TBL_CYHW_PROJECTBUDGET WHERE BUDGETID = #{recordparent}")
	TblCyhwProjectbudget getEntity(Integer recordparent);

//	@Select("SELECT ISBLACK FROM TBL_CYHW_PROJECTBUDGET WHERE BUDGETID = #{budgetid}")
//    Object excuteFunReturnUnique(Integer budgetid);

//	@Update("UPDATE TBL_CYHW_PROJECTBUDGET SET ISBLACK = 2,BLACKTYPE = '',EFFECTDATE='' WHERE BUDGETID = #{budgetid}")
//	void executeSql(Integer budgetid);

	@SelectProvider(method="findListByPageInfoOrgid",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	List<TblCyhwProjectbudget> findListByPageInfoOrgid(PageInfo<TblCyhwProjectbudget> pageInfo, BigDecimal orgid);

	@SelectProvider(method="findListByPageInfoCount",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer findListByPageInfoCount(BigDecimal orgid);

	@SelectProvider(method="findListByPage",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	List<TblCyhwProjectbudget> findListByPage(PageInfo<TblCyhwProjectbudget> pageInfo, String userid,BigDecimal orgid);

	@SelectProvider(method="findListByPageCount",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer findListByPageCount(String userid, BigDecimal orgid);

	@Select("SELECT * FROM TBL_CYHW_PROJECTBUDGET WHERE BUDGETID = #{budgetid}")
	String excuteFunReturnUnique(Integer budgetid);

	@SelectProvider(method="findListByPageInfoTcpb",type=TblCyhwProjectbudgetMapperSqlConifg.class)
    List<TblCyhwProjectbudget> findListByPageInfoTcpb(PageInfo<TblCyhwProjectbudget> pageInfo, BigDecimal orgid, TblCyhwProjectbudget tcpb);

	@SelectProvider(method="findListByPageInfoTcpbCount",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer findListByPageInfoTcpbCount(BigDecimal orgid, TblCyhwProjectbudget tcpb);

	@SelectProvider(method="findListByPageTcpb",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	List<TblCyhwProjectbudget> findListByPageTcpb(PageInfo<TblCyhwProjectbudget> pageInfo, String staffid, BigDecimal orgid, TblCyhwProjectbudget tcpb);

	@SelectProvider(method="findListByPageTcpbCount",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer findListByPageTcpbCount(String staffid, BigDecimal orgid, TblCyhwProjectbudget tcpb);

	@Select("SELECT * FROM TBL_CONTRACT_SPNODE WHERE ISWY='是' AND NODEPOST IS NOT NULL AND CONTRACTID IN (SELECT CONTRACTID FROM TBL_CYHW_UNIT WHERE CONTRACTXDFXINFO=#{budgetid})")
	List<TblContractSpnode> selectListByXdf(Integer budgetid);

	@SelectProvider(method="selectListByPageInfoStaff",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	List<TblCyhwProjectbudget> selectListByPageInfoStaff(PageInfo<TblCyhwProjectbudget> pageInfo, TblStaffUtil staff);

	@SelectProvider(method="selectCountByPageInfoStaff",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer selectCountByPageInfoStaff(PageInfo<TblCyhwProjectbudget> pageInfo, TblStaffUtil staff);

	@SelectProvider(method="selectListByPageInfoFlowid",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	List<TblCyhwProjectbudget> selectListByPageInfoFlowid(PageInfo<TblCyhwProjectbudget> pageInfo, TblStaffUtil staff, Integer taskCount, String flowid);

	@SelectProvider(method="selectListByPageInfoFlowidCount",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer selectListByPageInfoFlowidCount(TblStaffUtil staff, Integer taskCount, String flowid);

	@SelectProvider(method="selectCountByPageInfoCount",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer selectCountByPageInfoCount(TblStaffUtil staff, Integer taskCount);

	@Select("SELECT MAX(TO_NUMBER(REPLACE(REPLACE(COUNTERPARTNO,'CPNO',''),'-',''))) FROM TBL_CYHW_PROJECTBUDGET WHERE ORGID = #{orgid} AND COUNTERPARTNO LIKE 'CPNO%' AND RECORDTYPE = 'HTGL001'")
	Integer findAutoNumber(BigDecimal orgid);

	@SelectProvider(method="selectListByPageInfoFlowidTaskCount",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	List<TblCyhwProjectbudget> selectListByPageInfoFlowidTaskCount(PageInfo<TblCyhwProjectbudget> pageInfo, TblStaffUtil staff, Integer taskCount, String flowid);
	@SelectProvider(method="selectListByPageInfoFlowidTaskCountCount",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer selectListByPageInfoFlowidTaskCountCount(TblStaffUtil staff, Integer taskCount, String flowid);

	@SelectProvider(method="selectCountByPageInfoStaffTaskCount",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	List<TblCyhwProjectbudget> selectCountByPageInfoStaffTaskCount(PageInfo<TblCyhwProjectbudget> pageInfo, TblStaffUtil staff, String flowid);
	@SelectProvider(method="selectCountByPageInfoStaffTaskCo",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer selectCountByPageInfoStaffTaskCo(TblStaffUtil staff, String flowid);

	@Update("UPDATE TBL_CYHW_PROJECTBUDGET SET ISBLACK = 2,BLACKTYPE = '',EFFECTDATE='' WHERE BUDGETID = #{budgetid}")
	void executeSql(Integer budgetid, Object o);

	@SelectProvider(method="selectListByPageInfoFlowidTask",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	List<TblCyhwProjectbudget> selectListByPageInfoFlowidTask(PageInfo<TblCyhwProjectbudget> pageInfo, TblStaffUtil staff, boolean taskCount);
	@SelectProvider(method="selectListByPageInfoFlowidTaskCo",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer selectListByPageInfoFlowidTaskCo(TblStaffUtil staff, boolean taskCount);

	@SelectProvider(method="selectOppsiteBlackList",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	List<TblCyhwProjectbudget> selectOppsiteBlackList(PageInfo<TblCyhwProjectbudget> pageInfo, TblStaffUtil staff,
			boolean taskCount) throws Exception;
	
	@SelectProvider(method="selectOppsiteBlackListCount",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	Integer selectOppsiteBlackListCount(PageInfo<TblCyhwProjectbudget> pageInfo, TblStaffUtil staff, boolean taskCount) throws Exception;
	
	
//			@Select("select COUNTERPARTNO,BUDGETNAME,PROJECTSTAGEGOAL,COUNTERPARTADDRESS,COUNTERPARTHANK,\n" +
//			"TOTALTMONEY,CASE BLACKTYPE WHEN 1 THEN '短期' WHEN 2 THEN '长期' ELSE '未加入' END,EFFECTDATE from " +
//			"TBL_CYHW_PROJECTBUDGET where RECORDTYPE='HTGL001' AND BLACKTYPE IS NOT NULL AND ORGID = #{orgid} ")
//	TblCyhwProjectbudget selectBlackList(BigDecimal orgid);
	
	
	@Select("SELECT ATTID,ATTNAME,ATTPATH,ATTSIZE,MEMO,UPLOADTIME,UPLOADER FROM TBL_ATTACHMENT WHERE ATTID IN (SELECT ATTID FROM TBL_CYHW_PROJECTBUDGET_ATT WHERE BUDGETID = #{budgetId})")
	List<TblAttachment> selectAllATT(Integer budgetId);
	
	@SelectProvider(method="getList",type=TblCyhwProjectbudgetMapperSqlConifg.class)
	 List<JSONObject>  getList(String orgid,String startDate);
	@Select("SELECT * FROM TBL_CYHW_PROJECTBUDGET WHERE outsideId = #{outsideId}")
	TblCyhwProjectbudget findEntityByOutSideId(String outsideId);

}
